import pandas as pd

df = pd.read_csv("D:\py\pythonProject\population-data\data\originalData\年龄年度数据 .csv", skiprows=2,encoding="gbk")
df=df.iloc[:-2]
df['指标'] = df['指标'].str.replace('人口数(人口抽样调查)(人)', '', regex=False)

print(df.head())

df.to_csv(r"D:\py\pythonProject\population-data\data\temp\年龄结构.csv",encoding="gbk")